Bounded-pause time garbage collection system and method including write barrier associated with source and target instances of a partially relocated object

ABSTRACT

A partially relocated object identifier store including &#34;copy from&#34; identifier and &#34;copy to&#34; identifier storage accessible to write barrier logic allows the write barrier logic to maintain consistency between FromSpace and ToSpace instances of a partially relocated memory object without software trap handler overhead. Optional &#34;How far&#34; indication storage facilitates differentiation by the write barrier logic between a copied portion and an uncopied portion of the partially relocated memory object. An optional &#34;mode&#34; indication facilitates differentiation by the write barrier logic between a copy phase and a pointer update phase of relocation by the garbage collector implementation. In some embodiments, pointer update and copying phases may overlap. &#34;Copy to&#34; identifier storage facilitates broadcast of a store-oriented memory access to the FromSpace instance to both FromSpace and ToSpace instances. Similarly, during pointer update, &#34;Copy to&#34; and &#34;Copy From&#34; identifier storage facilitate broadcast of a store-oriented memory access to either the FromSpace instance or the ToSpace instance to both FromSpace and ToSpace instances.

RELATED APPLICATIONS

Bounded-Pause Time Garbage Collection System and Method including WriteBarrier associated with a Source Instance of a Partially RelocatedObject, naming Marc Tremblay, James Michael O'Connor, Guy L. Steele,Jr., Sanjay Vishin, Ole Agesen, Steven Heller, and Derek R. White asinventors, Ser. No. 08/883,291, filed on even date herewith.

Bounded-Pause Time Garbage Collection System and Method including Readand Write Barriers associated with an Instance of a Partially RelocatedObject, naming Marc Tremblay, James Michael O'Connor, Guy L. Steele,Jr., Sanjay Vishin, Ole Agesen, Steven Heller, and Derek R. White asinventors, Ser. No. 08/882,801, filed on even date herewith.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to garbage collection, and in particular,to methods and apparati for facilitating bounded pause time garbagecollection.

2. Description of the Related Art

Traditionally, most programming languages have placed responsibility fordynamic allocation and deallocation of memory on the programmer. Forexample, in the C programming language, memory is allocated from theheap by the malloc procedure (or its variants). Given a pointervariable, p, execution of machine instructions corresponding to thestatement p=malloc (sizeof(SomeStruct)) causes pointer variable p topoint to newly allocated storage for a memory object of size necessaryfor representing a SomeStruct data structure. After use, the memoryobject identified by pointer variable p can be deallocated, or freed, bycalling free(p). Pascal and C++ languages provide analogous facilitiesfor explicit allocation and deallocation of memory.

Unfortunately, dynamically allocated storage may become unreachable ifno reference, or pointer, to the storage remains in the set of rootreference locations for a given computation. Memory objects that are nolonger reachable, but have not been freed, are called garbage.Similarly, storage associated with a memory object can be deallocatedwhile still referenced. In this case, a dangling reference has beencreated. In general, dynamic memory can be hard to manage correctly. Inmost programming languages, heap allocation is required for datastructures that survive the procedure that created them. If these datastructures are passed to further procedures or functions, it may bedifficult or impossible for the programmer or compiler to determine thepoint at which it is safe to deallocate them.

Because of this difficulty, garbage collection, i.e., automaticreclamation of heap-allocated storage after its last use by a program,can be an attractive alternative model of dynamic memory management.Garbage collection is particularly attractive for functional languages,such as the JAVA™ language (JAVA is a trademark of Sun Microsystems,Inc.), Prolog, Lisp, Smalltalk, Scheme, Eiffel, Dylan, ML, Haskell,Miranda, Oberon, etc., which exhibit data sharing, delayed execution,and generally, less predictable execution orders than the procedurallanguages. See generally, Jones & Lins, Garbage Collection: Algorithmsfor Automatic Dynamic Memory Management, pp. 1-41, Wiley (1996) for adiscussion of garbage collection and the classical algorithms therefor.

Three classical garbage collection methods are reference counting,mark-sweep, and copying storage reclamation. The first, referencecounting, is based on maintaining a count of the number of references,e.g., pointers, to each memory object from active memory objects or rootreference locations. When a new memory object is allocated and a pointerthereto is assigned, the memory object's reference count is set to one.Then, each time a pointer is set to refer to the memory object, thememory object's reference count is incremented. When a reference to thememory object is deleted or overwritten, the reference count isdecremented. Memory objects with a reference count of zero areunreachable and can be collected as garbage. A reference countinggarbage collector implementation typically includes an additional field,the reference count, in each memory object and includes incrementing anddecrementing support as part of new object, delete object and updatepointer functions.

In contrast, tracing collector methods involve traversal of referencechains through memory to identify live, i.e., referenceable, memoryobjects. One such tracing collector method is the mark-sweep method inwhich reference chains through memory are traversed to identify and marklive memory objects. Unmarked memory objects are garbage and arecollected and returned to the free pool during a separate sweep phase. Amark-sweep garbage collector implementation typically includes anadditional field, e.g., a mark bit, in each memory object. Mark-compactcollectors add compaction to the traditional mark-sweep approach.Compaction relocates live objects to achieve beneficial reductions infragmentation. Reference count methods may also employ compaction.

Another tracing method, copying collection, divides memory (or a portionthereof) into two semi-spaces, one containing current data and the othercontaining old data. Copying garbage collection begins by reversing theroles of the two semi-spaces. The copying collector then traverses thelive objects in the old semi-space, FromSpace, copying reachable objectsinto the new semi-space, ToSpace. After all the live objects inFromSpace have been traversed and copied, a replica of the datastructures exists in ToSpace. In essence, a copying collector scavengeslive objects from amongst the garbage. A beneficial side effect ofcopying collection is that live objects are compacted into ToSpace,thereby reducing fragmentation.

Generational approaches build on the observations that (1) memoryobjects typically die young and that (2) tracing methods spendconsiderable resources traversing, copying, or relocating comparativelylong-lived objects. Generational garbage collection schemes divide theheap into two or more generations, segregating objects by age, andconcentrate collection efforts (or at least more vigorous collectionefforts) on the younger generation(s). Since the youngest generation issmall, garbage collection related pause times can, on average, be keptshort. Garbage collection within a generation can be by either copyingor mark-sweep collection. Promotion of memory objects from a younger toan older generation typically involves copying.

Because of the cost of copying large objects, some generationalapproaches have included large object areas. See e.g., Ungar andJackson, Tenuring Policies for Generation-based Storage Reclamation, ACMSIGPLAN Notices, 23(11), pp. 1-17 (1988), Ungar and Jackson, An AdaptiveTenuring Policy for Generation Scavengers, ACM Transactions onProgramming Languages and Systems, 14(1), pp. 1-17 (1992). Typically,the technique is to separate a large object into a header portion storedin the generational part of the heap and a body portion stored in thelarge object area. The header portions are scavenged like other objects,but resources are not expended to copy the body portions. Ungar andJackson found that pause times could be reduced by a factor of four byallocating 330 Kbytes to a large object area.

For interactive or real-time applications, the shortness of garbagecollection pauses is an important figure of merit. Traditionalimplementations of tracing garbage collectors periodically interruptexecution of application programs in order to traverse memory in searchof memory regions that are no longer in use. Unfortunately, hardreal-time systems require worst-case guarantees that results be computedon-time. Even in mere interactive systems, pause time should be boundedand short. So-called incremental garbage collection methods attempt toavoid lengthy pauses caused by start and stop reclamation and insteadinterleave collection with application program cycles. To achieve thisgoal, an incremental collector must coherently manage heap accesses bythe collector and application program (often more generally referred toas a mutator). Concurrent collectors, e.g., in a multiprocessor, presentsimilar, though more stringent fine grain synchronization requirements.

In general, interleaved or concurrent relocating collectors presentmultiple-readers, multiple writers synchronization problems. Both readand write barrier methods have been used to prevent a mutator fromdisrupting garbage collection by altering the connectivity of the memoryobject referencing graph in a way that interferes with the collector'straversal thereof. See e.g., Steele, Multiprocessing CompactifyingGarbage Collection, Communications of the ACM, 18(9), pp. 495-508 (1975)(write barrier, mark-sweep-compact collection); Dijkstra et al.,On-the-fly Garbage Collection: An Exercise in Cooperation,Communications of the ACM, 21(11), pp. 965-975 (1978) (write barrier);Kung & Song, An Efficient Parallel Garbage Collection System and itsCorrectness Proof, IEEE Symposium on Foundations of Computer Science,pp. 120-131 (1977) (write barrier); Baker, List Processing in Real-timeon a Serial Computer, Communications of the ACM, 21(4), pp. 280-93(1978) (read barrier, copying collector); Brooks, Trading Data Space forReduced Time and Code Space in Real-time Garbage Collection on StockHardware, in Conference Record of the 1984 ACM Symposium on Lisp andFunctional Programming, Austin, Tex., pp. 256-62 (1984) (write barrier,copying collector); and Dawson, Improved Effectiveness from a Real-timeLisp Garbage Collector, Conference Record of the 1992 ACM Symposium onLisp and Functional Programming, San Francisco, Calif., pp. 159-67(1982) (write barrier, copying collector).

The Symbolics 3600 provided hardware read-barrier and write-barriersupport for Baker style copying collection and for trappingintergenerational pointer stores. See Moon, Architecture of theSymbolics 3600, Proceedings of the 12th Annual International Symposiumon Computer Architecture, pp. 76-83 (1985). The MIT Lisp machine and TIExplorer also provided hardware read-barrier support for Baker stylecopying collection. Nilsen and Schmidt describe a garbage collectedmemory module which implements hardware read- and write-barriers in U.S.Pat. No. 5,560,003.

In addition to the fundamental challenge of managing mutator accesses toprevent alterations to the connectivity of the memory object referencinggraph in a way that would interfere with the collector's traversalthereof, a bounded pause time relocating collectors should address thesubstantial period of time required to relocate a large and/or popularmemory object. A garbage collector can ensure that memory objects can becompletely relocated within a bounded interval, by relegating largeobjects incompatible with the bounded interval to a large object areawhich may be collected by a non-relocating method (see e.g., Ungar andJackson, Tenuring Policies for Generation-based Storage Reclamation, ACMSIGPLAN Notices, 23(11), pp. 117 (1988)) or may be uncollected. However,lazy or incremental copying approaches are preferable.

Baker's solution was to include an additional link word in the header oflarge objects. In a FromSpace instance of the object, the link wordstored a forwarding address to a ToSpace instance of the object. In theToSpace instance of the object, the link word stored a backward link tothe FromSpace instance. After the forwarding and backward links are set,the object was copied incrementally. Like small objects, fields of thelarge object were copied and scanned for pointers back into FromSpaceobjects that had not yet been copied. Baker used the scanned/unscannedboundary, defined by a garbage collection variable, scan, to steer writeaccesses to the partially copied large object. The cost of Baker'sscheme, apart from an additional header word was a softwarewrite-barrier to writes into the ToSpace instance of the large object.If the address was greater than scan, the write was performed in theOldSpace instance using the backward link; otherwise the write wasperformed in the NewSpace instance.

Nilsen and Schmidt presented a hardware solution based on Baker'scopying collector. In particular, Nilsen and Schmidt provided a garbagecollected memory module in which a hardware read-barrier maintains theillusion that collection is complete. A hardware arbiter in the garbagecollected memory module provided a hardware Baker-type read-barrier, andin addition provided read and write barriers to accesses into an as yetuncopied portion of an object instance in ToSpace. The garbage collectedmemory module maintained memory address registers to indicate thebeginning and end of the uncopied portion. Read and write accesses tothe uncopied portion were directed to the FromSpace instance.

SUMMARY OF THE INVENTION

Accordingly, it has been discovered that a write barrier to stores intoa partially relocated large and/or popular memory object facilitatesbounded pause time implementations of relocating garbage collectors,including e.g., copying collectors, generational collectors, andcollectors providing compaction. Partially relocated object identifierstorage and a write barrier responsive thereto allows relocation oflarge and/or popular memory objects by a garbage collectorimplementation to be interrupted so as to meet bounded pause timeguarantees to a mutator process.

A partially relocated object identifier store including "copy from"identifier and "copy to" identifier storage accessible to write barrierlogic allows the write barrier logic to maintain consistency betweenFromSpace and ToSpace instances of a partially relocated memory objectwithout software trap handler overhead. Optional "How far" indicationstorage facilitates differentiation by the write barrier logic between acopied portion and an uncopied portion of the partially relocated memoryobject. An optional "mode" indication facilitates differentiation by thewrite barrier logic between a copy phase and a pointer update phase ofrelocation by the garbage collector implementation. In some embodiments,pointer update and copying phases may overlap. "Copy to" identifierstorage facilitates broadcast of a store-oriented memory access to theFromSpace instance to both FromSpace and ToSpace instances. Similarly,during pointer update, "Copy to" and "Copy From" identifier storagefacilitate broadcast of a store-oriented memory access to either theFromSpace instance or the ToSpace instance to both FromSpace and ToSpaceinstances.

Some embodiments may not differentiate between pointer update andcopying phases or between copied and uncopied portions of the partiallyrelocated object. Furthermore, although "Copy to" and "Copy From"identifier storage advantageously allows the write barrier logic tomaintain consistency between FromSpace and ToSpace instances of apartially relocated memory object without software trap handleroverhead, some embodiments may include such a software trap handler. Avariety of alternative allocations of functionality between writebarrier logic and a partially relocated object trap handler areenvisioned and fall within the scope of the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention may be better understood, and its numerousobjects, features, and advantages made apparent to those skilled in theart by referencing the accompanying drawings.

Figures 1a and 1b (collectively referred to herein as FIG. 1) are ablock diagram of an exemplary embodiment of a virtual machine hardwareprocessor that includes support for bounded pause-time garbage collectorimplementations in accordance with this invention.

FIG. 2 depicts "builds upon" relationships between software and hardwarecomponents of a JAVA application environment including hardwareprocessor (FIG. 1) and software components of an exemplary JAVA virtualmachine implementation.

FIG. 3 illustrates several possible add-ons to the hardware processor ofFIG. 1.

FIGS. 4a and 4b (collectively referred to herein as FIG. 4) depict oneembodiment of partially relocated object identifier store and anexemplary memory object referencing graph in accordance with ansemispace memory organization for a copying garbage collector prior tocopying.

FIG. 5 depict the partially relocated object identifier store andsemispace memory organization of FIG. 4 during copying of a large objectfrom FromSpace to ToSpace.

FIG. 6 depicts accesses of a copying collector process and of a mutatorprocess to FromSpace and ToSpace portions of a collected memory areathat includes a partially relocated large object. FIG. 6 illustratesoperation of a write barrier of the hardware processor of FIG. 1 inconjunction with the partially relocated object identifier store ofFIGS. 4 and 5.

FIG. 7 depicts an embodiment of a bounded-pause time garbage collectionsystem including a barrier to stores to a copy-from instance of apartially relocated object and a trap handler therefor.

FIG. 8 depicts an embodiment of a bounded-pause time garbage collectionsystem including a hardware barrier to stores to a copy-from instance ofa partially relocated object and including a partially relocated objectidentifier store having copy-from and copy-to instance identifiers. Theembodiment of FIG. 8 selectively broadcasts stores to both the copy-frominstance and copy-to instance of the partially relocated object.

FIG. 9 depicts an embodiment of a bounded-pause time garbage collectionsystem including a hardware barrier to stores to a copy-from instance ofa partially relocated object and including a partially relocated objectidentifier store having a copy-from instance identifier, a copy-toinstance identifier, and a copied/uncopied boundary identifier. Theembodiment of FIG. 9 selectively directs or broadcasts stores dependingon the partial relocation state of the partially relocated object toallow incremental copying.

FIG. 10 depicts an embodiment of a bounded-pause time garbage collectionsystem including barriers to stores to copy-from and copy-to instancesof a partially relocated object and including a partially relocatedobject identifier store having copy-from and copy-to instanceidentifiers. The embodiment of FIG. 10 allows both incremental copyingand incremental pointer update.

FIG. 11 depicts an embodiment of a bounded-pause time garbage collectionsystem including barriers to stores to copy-from and copy-to instancesof a partially relocated object and including a partially relocatedobject identifier store having a copy-from instance identifier, acopy-to instance identifier, a copied/uncopied boundary identifier, anda garbage collection phase indicator. The embodiment of FIG. 11selectively directs or broadcasts stores depending on the partialrelocation state of the partially relocated object and garbagecollection phase to allow both incremental copying and incrementalpointer update.

FIG. 12 depicts an embodiment of a bounded-pause time garbage collectionsystem including barriers to loads from a copy-from instance of apartially relocated object and to stores to the copy-from instance andincluding a partially relocated object identifier store having acopy-from instance identifier, a garbage collection phase indicator, anda partially relocated object trap handler. The embodiment of FIG. 12selectively redirects or broadcasts stores and selectively redirectsloads to allow both incremental copying and incremental pointer update,and in some variations, overlapping copy-from and copy-to instances.

FIG. 13 depicts an embodiment of a bounded-pause time garbage collectionsystem including barriers to loads from a copy-from instance of apartially relocated object and to stores to the copy-from instance andincluding a partially relocated object identifier store having acopy-from instance identifier, a copy-to instance identifier, and agarbage collection phase indicator. The embodiment of FIG. 13selectively redirects or broadcasts stores and selectively redirectsloads to allow both incremental copying and incremental pointer update.

FIG. 14 depicts an embodiment of a bounded-pause time garbage collectionsystem including barriers to loads from a copy-from instance of apartially relocated object and to stores to the copy-from instance andincluding a partially relocated object identifier store having acopy-from instance identifier, a copy-to instance identifier, acopied/uncopied boundary identifier, and a garbage collection phaseindicator. The embodiment of FIG. 13 selectively redirects stores andselectively redirects loads to allow both incremental copying,incremental pointer update, and overlapping copy-from and copy-toinstances.

FIG. 15 depicts operation of a bounded pause time garbage collectionsystem allowing overlapping FromSpace and ToSpace portions of apartially relocated large object.

FIG. 16 depicts an object reference (objectref) format in accordancewith an embodiment of this invention.

FIG. 17A depicts an object format in accordance with an embodiment ofthis invention.

FIG. 17B depicts an alternative handled object format in accordance withan embodiment of this invention.

The use of the same reference symbols in different drawings indicatessimilar or identical items.

DESCRIPTION OF THE PREFERRED EMBODIMENT(S)

The following sets forth a detailed description of the best contemplatedmode for carrying out the invention. The description is intended to beillustrative of the invention and should not be taken to be limiting.

Architectural support for bounded pause time implementations ofrelocating garbage collectors includes storage to identify locationsfrom which (and in some embodiments, to which) a large and/or popularmemory object is being relocated. As used herein, a large object is anymemory object of size, structure, or content such that relocation of thecomplete memory object, potentially including updates of referencesthereto, may, under worst case conditions, be incompatible with boundedpause time guarantees of a garbage collector implementation. Embodimentsin accordance with the present invention will exhibit varying degrees ofconservatism with respect to operative definitions of a large object.For example, some embodiments may employ a size threshold, whereasothers may include reference counts in the large object calculus. Stillother embodiments, particularly those based substantially on hardware,may exploit the architectural support described herein without regard tomemory object size. As used herein, a popular object is any memoryobject having a reference count such that relocation of the memoryobject, including updates of references thereto, may, under worst caseconditions, be incompatible with bounded pause time guarantees of agarbage collector implementation. As above, embodiments in accordancewith the present invention will exhibit varying degrees of conservatismwith respect to operative definitions of a popular object.

In general, embodiments in accordance with the present invention mayemploy architectural support described herein for relocating largeobjects, popular objects, large and popular objects, all objects(including but not limited to large and/or popular objects), etc.Although such architectural support may be provided in hardware, insoftware, or in a combination of hardware and software, embodiments inwhich the architectural support is provided substantially in hardwarewill typically provide both increased performance and reduced memoryrequirement advantages. For this reason, an exemplary hardware processorembodiment is described herein. However, based on this description,those of skill in the art will appreciate alternative embodiments whichfall within the scope of the claims which follow.

As used herein, relocating garbage collector is any garbage collectorwhich as part of its operation relocates memory objects, including e.g.,copying collectors, generational collectors, and collectors providingcompaction or object relocation to reduce fragmentation and/or improvelocality. Real-time or bounded pause time implementations of suchrelocating garbage collectors will typically be implemented as anincremental garbage collection software process whose computations areinterleaved with user process activity. However, those of skill in theart will recognize concurrent garbage collection implementations basedon the description herein. Furthermore, those of skill in the art willrecognize suitable modifications, including provision of storage toidentify multiple partially relocated objects, to support parallelcollection implementations.

A JAVA Virtual Machine Instruction Processor Embodiment

FIG. 1 depicts an exemplary hardware embodiment of a virtual machineinstruction processor 100, hereinafter hardware processor 100, thatincludes support for bounded pause time relocating garbage collection inaccordance with the present invention, and that directly executesprocessor architecture independent JAVA virtual machine instructions.The performance of hardware processor 100 in executing virtual machineinstructions is typically better than high-end CPUs, such as the IntelPENTIUM microprocessor or the Sun Microsystems ULTRASPARC processor,(ULTRASPARC is a trademark of Sun Microsystems of Mountain View, Calif.,and PENTIUM is a trademark of Intel Corp. of Sunnyvale, Calif.)interpreting the same virtual machine instructions with a software JAVAinterpreter or with a JAVA just-in-time (JIT) compiler. In addition,hardware processor 100 is low cost and exhibits low power consumption.As a result, hardware processor 100 is well suited for portableapplications.

Because hardware processor 100 provides a JAVA virtual machineinstruction processor implementation substantially in hardware, 25-50Kilobytes (Kbytes) of memory storage, e.g., read-only memory or randomaccess memory, otherwise required by a software interpreter can beeliminated or alternatively allocated. Hardware support for garbagecollection provides further advantages for a limited memory JAVA virtualmachine implementation by reducing in-line code for garbage collection(e.g., compiler supplied read and/or write barrier support), byfacilitating improved utilization of limited memory, and by reducinggarbage collection overheads and pause times. In environments where theexpense of a large memory is prohibitive, including, for example, anInternet chip for network appliances, a cellular telephone processor,other telecommunications integrated circuits, or other low-power,low-cost applications such as embedded processors, and portable devices,hardware processor 100 is advantageous.

Even in environments where large memory is viable, hardware support forgarbage collection reduces overheads associated with barrierimplementations, facilitates improved utilization of memory, and reducespause times for relocating garbage collector implementations. Inparticular, hardware processor 100 provides advantages for garbagecollection methods and implementations in the context of an exemplaryJAVA virtual machine implementation. However, based on the descriptionherein, those of skill in the art will recognize variations for otherJAVA virtual machine implementations, including e.g., interpreted andJIT compiler JAVA virtual machine implementations, as well as for othernon-JAVA virtual machine implementations.

As used herein, a virtual machine is an abstract computing machine that,like a real computing machine, has an instruction set and uses variousmemory areas. A virtual machine specification defines a set of processorarchitecture independent virtual machine instructions that are executedby a virtual machine implementation. In general, a virtual machineimplementation may be in hardware (e.g., as in the case of hardwareprocessor 100), in software (e.g., as in the case of interpreted and JITcompiler implementations), or in hardware and software. Each virtualmachine instruction defines a specific operation that is to beperformed. The virtual machine need not understand the computer languagethat is used to generate virtual machine instructions or the underlyingimplementation of the virtual machine. Only a particular format forvirtual machine instructions needs to be understood. In an exemplaryembodiment, the virtual machine instructions are JAVA virtual machineinstructions. Each JAVA virtual machine instruction includes one or morebytes that encode instruction identifying information, operands, and anyother required information.

In this embodiment, hardware processor 100 (FIG. 1) processes the JAVAvirtual machine instructions, which include bytecodes. Hardwareprocessor 100 directly executes most of the bytecodes. However,execution of some of the bytecodes is implemented via microcode.Lindholm & Yellin, The JAVA™ Virtual Machine Specification(Addison-Wesley, 1996), ISBN 0-201-63452-X, which is incorporated hereinby reference in its entirety, includes an exemplary set of JAVA virtualmachine instructions. The particular set of virtual machine instructionssupported by a hardware processor 100 is not an essential aspect of thisinvention. However, in view of the virtual machine instructions, thoseof skill in the art can modify the invention for a particular set ofvirtual machine instructions, or for changes to the JAVA virtual machinespecification.

In one embodiment, hardware processor 100 includes an I/O bus and memoryinterface unit 110, an instruction cache unit 120 including instructioncache 125, an instruction decode unit 130 including non-quick to quicktranslator cache 131, a unified execution unit 140, a stack managementunit 150 including stack cache 155, a data cache unit 160 including datacache 165, and program counter and trap control logic 170. Support forgarbage collection features described herein resides primarily ininteger unit 142 and register 144 of execution unit 140 with someadditional support in program counter and trap control logic 170(including e.g., support for forcing the program counter to a next JAVAvirtual machine instruction following a trapping store). Each of theseunits is described below. In addition, an exemplary embodiment ofhardware processor 100 is described in greater detail in a co-pendingU.S. patent application Ser. No. 08/786,351, entitled, "INSTRUCTIONFOLDING FOR A STACK-BASED MACHINE," naming James Michael O'Connor andMarc Tremblay as inventors, filed Jan. 23, 1997, the entirety of whichis hereby incorporated by reference.

FIG. 2 depicts a "builds upon" relationship between software andhardware components of a JAVA application environment such as, forexample, an application environment partially defined by and partiallyexecutable on hardware processor 100 (FIG. 1). JAVA application/appletsoftware 210 exploits software components defining an applet/applicationprogramming interface 220 including AWT classes 241, net and I/O classes242, and JAVA OS windows 243, JAVA OS graphics 248, TCP 244, NFS 245,UDP 246, IP 247, Ethernet 222, keyboard 249, and mouse 221 softwarecomponents, which in one embodiment include JAVA bytecodes. In theembodiment of FIG. 2, JAVA OS graphics 248 and Ethernet 222 softwarecomponents also include extended bytecodes beyond those defined by thebaseline JAVA Virtual Machine Specification. Components of an embeddedapplication programming interface (EAPI) 230 include foundation classes231 and hardware and software components of JAVA virtual machineimplementation 250 in accordance with the JAVA Virtual MachineSpecification.

JAVA virtual machine implementation 250 includes hardware processor 100and trap code executable thereon to evaluate JAVA virtual machineinstructions. In addition, JAVA virtual machine implementation 250includes hardware support for extended bytecodes (including e.g.,pointer store bytecodes and memory access barriers described below inthe context of garbage collection); class loader 252, byte code verifier253, thread manager 254, and garbage collector 251 software, andmicrokernel 255. JAVA virtual machine implementation 250 includes a JAVAvirtual machine specification compliant portion 250a as well asimplementation dependent portions. Although the JAVA virtual machinespecification specifies that garbage collection be provided, theparticular garbage collection method employed isimplementation-dependent.

Architectural features for garbage collection described herein in thecontext of an exemplary hardware processor 100 embodiment of JAVAvirtual machine implementation 250 are particularly adapted forgenerational garbage collection methods. However, based on thisdescription, those of skill in the art will recognize the application ofbounded-pause time support of this invention to relocating collectors ingeneral, including e.g., non-generational collector implementations,incremental mark-compact collectors, copying collectors, etc.

FIG. 3 illustrates several possible add-ons to hardware processor 100 tocreate more complicated system. Circuits supporting any of the eightfunctions shown, i.e., NTSC encoder 501, MPEG 502, Ethernet controller503, VIS 504, ISDN 505, I/O controller 506, ATM assembly/reassembly 507,and radio link 508 can be integrated into the same chip as hardwareprocessor 100 of this invention.

In addition, those of skill in the art will appreciate a wide variety ofcomputer systems incorporating hardware processor 100, includingembodiments of hardware processor 100 with any of the above-describedadd-on circuits. An exemplary computer system embodiment includesphysical memory storage (e.g., RAM and/or ROM), computer readable mediaaccess devices (e.g., disk, CD-ROM, tape, and/or memory technology basedcomputer readable media access devices, etc.), input/output deviceinterfaces (e.g., interfaces for keyboard and/or pointing devices, fordisplay devices, etc.), and communications devices and/or interfaces.Suitable communications devices and/or interfaces include those fornetwork- or telephony-based communications, for interfacing withcommunications networks including land-line and/or wireless portions ofa public switched network, private networks, etc. In some embodiments ofthis invention, instruction streams (including e.g., JAVA bytecodes) aretransmitted and/or received for execution by hardware processor 100 viasuch communications devices or interfaces.

Architectural Support for Garbage Collection

Hardware processor 100 provides hardware support for a variety ofgarbage collection methods, including relocating collector methodsimplemented as garbage collection software executable thereon. Inparticular, hardware processor 100 includes a partially relocated objectidentifier store and barrier support. In some embodiments such barriersupport includes write barrier support for programmer selectablefiltering of stores and/or support for execution-time resolution ofstore bytecodes to pointer-specific bytecodes to facilitate pointerstore trapping, each as described in greater detail in a co-pending U.S.patent application Ser. No. 08/841,543, entitled "GENERATION ISOLATIONSYSTEM AND METHOD FOR GARBAGE COLLECTION," naming James MichaelO'Connor, Marc Tremblay, and Sanjay Vishin as inventors and filed Apr.23, 1997, the entirety of which is hereby incorporated by reference.

Partially Relocated Object Identifier Store

FIG. 4A depicts one embodiment of a partially relocated objectidentifier store 410 including from field 411, to field 412 and howfarfield 413. FIG. 4B depicts FromSpace 420 and ToSpace 430 portions ofmemory storage in accordance with a copying collector method. In agenerational collector implementation, FromSpace 420 and ToSpace 430portions may be semi-spaces of a single generation or may be portions ofyoung and old generation spaces respectively. Alternatively, FromSpace420 and ToSpace 430 portions may be semi-spaces in a non-generationalcollection space. Furthermore, FromSpace 420 and ToSpace 430 portionsmay overlap, may individually be contiguous or non-contiguous, are notnecessarily of fixed size or have fixed locations in the memory storage.Additionally, in some embodiments, multiple FromSpace and ToSpaceportions are supported with suitable modifications to partiallyrelocated object identifier store 410 and to the barriers describedherein. FIG. 4B depicts a first referencing state of live memory objectsA, B, C and large object 450 prior to copying into ToSpace 430. Rootpointer set 440 is representative of any root pointer set into thereferencing structure, including e.g., pointers which originate fromentries of operand stack and/or local variables storage represented instack cache 155.

FIG. 5 depicts a second referencing state of partially relocated objectidentifier store 410, FromSpace 420, and ToSpace 430 at interruption oflarge object 450 relocation. Live memory objects A and B have beencopied to corresponding instances A' and B' in ToSpace 430. Uponinterruption of the copying, large object 450 includes a copied portion551 and a not completely copied portion 552. Contents of the copiedportion 551 of large object 450 have been copied to a correspondingportion 551a of a ToSpace 430 instance of large object 450. ToSpace 430storage for the remaining not completely copied portion of large object450 is shown as portion 552a. From field 411 identifies large object 450in FromSpace 420, to field 412 identifies the corresponding partiallyrelocated instance 450a of large object 450, and howfar field 413identifies a boundary between copied portion 551 and not completelycopied portion 552 of large object 450. An overlapping copy directionfield (not shown) is optional. In one embodiment, such a copy directionfield includes a copy direction bit whose state indicates a forward orbackward direction for copying of overlapped FromSpace and ToSpaceinstances. In other embodiments, copy direction is derived from therelative values of from field 411 and to field 412, as will beappreciated by those of skill in the art.

Howfar field 413 indicates the progress of large object copying and/orenables write barrier hardware and a partially relocated object traphandler to appropriately handle mutator accesses to a partially copiedlarge object. In the embodiment of FIG. 5, howfar field 413 indicatesthe address in memory of the boundary between copied portion 551 anduncopied portion 552. Nonetheless, those of skill in the art willrecognize, based on this description, a variety of suitable alternativeencodings including, e.g., an index off of the memory location indicatedby from field 411, an indication of a corresponding boundary in theToSpace instance 550a of large object 450, etc. Howfar field 413 encodesany such suitable indication.

Referring now to FIG. 6, partially relocated object identifier store 410is shown in the context of mutator process 610 and garbage collectorprocess 620. In the embodiment of FIG. 6, mutator process 610 andgarbage collector process 620 are each defined by JAVA virtual machineinstructions executable by hardware processor 100. Garbage collectorprocess 620 includes any relocating collector. Although the descriptionwhich follows is for the semi-space copying collector described abovewith reference to FIG. 5, those of skill in the art will recognize theapplicability to other relocating collectors. In the course of copyinglarge object 450 from FromSpace 420 to ToSpace 430, garbage collectorprocess 620 reads from and writes to collected space 630.

In one embodiment, garbage collector process 620 updates from field 411and to field 412 at the beginning of large object 450 copying andupdates howfar field 413 during copying such that, upon interruption bymutator process 610, howfar field 413 indicates the boundary betweencopied portion 551 and uncopied portion 552. In embodiments forconcurrent mutator process 610 and garbage collector process 620execution (e.g., in a multiprocessor), locking of howfar field 413 isprovided and suitable methods therefor will be recognized by those ofskill in the art. Alternative embodiments may optionally forgoincremental updating of howfar field 413 in favor of an update oninterruption.

Mutator process 610 reads from and writes to memory which includescollected space 630. In one embodiment, hardware processor 100 includesinteger unit 142 support for a barrier 660 which compares objectreferencing information (e.g., an objectref) to contents of from field411, to field 412, or both. A match with contents of from field 411indicates that the referenced object is the FromSpace 420 instance ofpartially relocated large object 450. A match with contents of to field412 indicates that the referenced object is the partially copied ToSpace430 instance 450a. In some embodiments, evaluation of the particularfield offset into the referenced object is compared against contentshowfar field 413 to refine barrier 660 handling of copied and uncopiedportions of the referenced object.

In various embodiments more particularly described below, barrier 660includes write barrier support responsive to partially relocated objectidentifier store 410. In some embodiments, barrier 660 also includesread barrier support responsive to partially relocated object identifierstore 410. In some embodiments, barrier 660 includes hardware readand/or write barrier support for trapping to a software partiallyrelocated object trap handler which appropriately handles the trappingaccess (e.g., by broadcasting a write access, redirecting a writeaccess, redirecting a read access, or allowing an access to completenormally). In other embodiments, a hardware read and/or write barrieritself provides such appropriate handling without software trap handleroverhead.

In some embodiments, bounded pause time relocation is provided byelements of barrier 660 that allow incremental copying of a large and/orpopular object while pointer updates thereto are via an objectreferencing handle. In such embodiments, pointer updates to even popularobjects are trivially provided by update of a single pointer, i.e., ofthe object referencing handle. In other embodiments, bounded pause timerelocation provided by elements of barrier 660 includes support forincremental updating of pointers to a popular, and possibly large,object. As used herein, bounded pause time relocation includes bothcopying and pointer update. Those of skill in the art will appreciatethe applicability of embodiments described herein to bounded pause timerelocation of large objects, to bounded pause time relocation of popularobjects, and to bounded pause time relocation of large, popular objects.Handled and unhandled object referencing is described below in greaterdetail.

Depending on the garbage collection method(s) supported by a particularembodiment of hardware processor 100, write and/or read barrier supportmay be provided to prevent mutator process 610 from interfering withgarbage collector process 620 by altering connectivity of the memoryobject referencing graph in a way that interferes with the collectorstraversal thereof. For example, in one embodiment of hardware processor100, programmer selectable hardware write barriers to intergenerationalpointer stores, to all pointer stores, and to all stores (includingsupport for filtered barrier variants of each) are provided as describedin greater detail in the above-incorporated co-pending U.S. patentapplication Ser. No. 08/841,543, entitled, "GENERATION ISOLATION SYSTEMAND METHOD FOR GARBAGE COLLECTION," naming James Michael O'Connor, MarcTremblay, and Sanjay Vishin as inventors, and filed on Apr. 23, 1997. Inone embodiment of barrier 660, support for such additional barriers isintegrated with the above-described barrier to stores into a partiallyrelocated large object.

In embodiments in accordance with FIG. 1, a partially relocated objecttrap handler includes JAVA virtual machine instruction bytecodesexecutable on hardware processor 100 and initiated by program counterand trap control logic 170. Garbage collection traps, including e.g., apartially relocated object trap, are triggered before the trapping writeis itself evaluated. Therefore, in order to prevent the processor fromtrapping infinitely, partially relocated object trap handler 650emulates the trapping write along with the additional garbagecollection-related functions. In one embodiment, program counter andtrap control logic 170 then forces the program counter to the next JAVAvirtual machine instruction following the trapping write. Based on themore detailed description which follows, those of skill in the art willrecognize a variety of valid behaviors for a partially relocated objecttrap handler depending on consistency policies enforced.

Although garbage collection has been described generally above withrespect to the illustrative FIG. 6 embodiment of partially relocatedobject identifier store 410 including from field 411, to field 412,howfar field 413, and in the context of a barrier 660 potentiallyincluding a partially relocated object trap handler, a variety ofalternative embodiments are also suitable. In many of these alternativeembodiments, a partially relocated object trap handler can be eliminatedand mutator process accesses can be properly handled by hardware barriersupport, thereby reducing overhead associated with a trap handler. Basedon the description of exemplary embodiments which follows, those ofskill in the art will appreciate a variety of additional combinationsand variations which fall within the scope of the claims.

Write Barrier Associated with Copy-From Instance Identifier Store

FIG. 7 depicts an embodiment having a Copy-From register field with anassociated write barrier. In particular, the embodiment of FIG. 7includes from field 411 of partially relocated object identifier store410 (see FIG. 4), hardware write barrier 740, and partially relocatedobject trap handler 750. In the embodiment of FIG. 7, from field 411 isrepresented in registers 144 of hardware processor 100. Mutator process610, garbage collector process 620, and partially relocated object traphandler 650 include software executable on hardware processor 100. Thisembodiment facilitates incremental copying of large objects. However,without additional support, this embodiment is not well suited toincremental update of large numbers of pointers to the ToSpace 430instance of a popular relocated object. Nonetheless, for garbagecollection systems in which objects are referenced via handles, forexample, as described below with reference to FIG. 17B, such anembodiment reduces hardware requirements and is viable for bounded pausetime relocation since updating a single handle to the ToSpace 430instance can be trivial.

Mutator process 610 makes read and write accesses from and to collectedspace 630. Read accesses are unaffected by garbage collection support.However, write accesses are selectively trapped by hardware writebarrier 740. Hardware write barrier 740 triggers partially relocatedobject trap handler 750 in response to a correspondence between thecontents of from field 411 and the target objectref associated withwrite access 701. In this embodiment, partially relocated object traphandler 750, determines, or optionally maintains memory storage for, theCopy-To destination information such as that otherwise stored in tofield 412. In addition, garbage collection software may optionallymaintain storage for HowFar information such as that otherwise stored inhowfar field 413. When mutator process 610 stores to the FromSpace 420instance of the large object, store data is either broadcast to both thecopy-from instance 450 and copy-to instance 450A or, in embodimentswhich provide storage for howfar information, the howfar storage isinspected and the store is broadcast to both instances if the stored-tofield of the large object has already been copied, and otherwisedirected to copy-from instance 450. Those of skill in the art willappreciate a variety of methods by which garbage collector process 620may update to field and howfar field storing variables 751 available topartially relocated object trap handler 750. Update 701 is by any suchsuitable method.

As described above, garbage collector process 620 updates from field 411of partially relocated object identifier store 410 to identify copy-frominstance 450 of the large object. In this embodiment, no pointers to thecopy-to instance are available to mutator process 610 until the handlefor the large object has been updated after copying is complete.Therefore, no barrier to accesses to copy-to instance 450A need bemaintained. This embodiment is not configured for overlapped copy-fromand copy-to instances; however, support for overlapped instances is notnecessary for many relocating collector methods, e.g., generationalscavenging or copying collector methods.

In one embodiment, hardware write barrier 740 is provided by integerunit 142 (FIG. 1) logic responsible for evaluating a store-orientedbytecode (e.g., putfield₋₋ quick, putfield, aastore, etc.). In such anembodiment, logic implementing hardware write barrier 740 traps writesto the Copy-From instance identified by contents of from field 411. Forexample, the desired behavior of hardware write barrier 640A isdescribed by the following logic equations.

    ______________________________________             if (objectref == FROM) then               generate gc.sub.-- notify    ______________________________________

where gc₋₋ notify is an exemplary trap handler. Those of skill in theart will appreciate a variety of suitable logic implementations,including logic implementations combining other write barrierfunctionality such as intergenerational pointer store trapping, asdescribed above. How far information may optionally be provided ashowfar field 413 in registers 144 (see FIG. 4, not shown in FIG. 7) tobetter tailor trapping by hardware write barrier 740 to only thosesituations in which broadcast is necessary, thereby reducing overheadsassociated with partially relocated object trap handler 750 invocations.

FIG. 8 depicts an embodiment including a Copy-To register field (e.g.,to field 412) in addition to a Copy-From register field (e.g., fromfield 411) with associated write barrier 840. The embodiment of FIG. 8provides a write barrier to stores to fields of an object identified bythe contents of from field 411 and advantageously eliminates partiallyrelocated object trap handler 750 and its associated overheads. Thisembodiment facilitates incremental (bounded pause time) copying of largeobjects, but like that of FIG. 7, is not well suited to bounded pausetime update of large numbers of pointers to the ToSpace 430 instance ofa copied object. As before, handled object references can mitigate thislimitation, allowing overall bounded pause time relocation of evenpopular large objects, albeit at the expense of an additional level ofindirection.

By maintaining a Copy-To register field in hardware, e.g., as to field412 in registers 144, write accesses to the Copy-From instance can bebroadcast to both the Copy-From and Copy-To instances by hardware writebarrier 840 without software rap handler intervention. In oneembodiment, hardware write barrier 840 is provided by integer unit 142(FIG. 1) logic responsible for evaluating a store-oriented bytecode. Insuch an embodiment, logic implementing hardware write barrier 840broadcasts store₋₋ data to both Copy-From and Copy-To instancesrespectively identified by objectref and contents of to field 412. Anexemplary hardware write barrier 840 is described by the following logicequations.

    ______________________________________    if (objectref == FROM  {           store.sub.-- data => *(objectref + offset)           store.sub.-- data => *(TO + offset)    ______________________________________

where offset is the offset into the large object of the target fieldassociated with the store-oriented bytecode. Those of skill in the artwill appreciate a variety of suitable logic implementations, includinglogic implementations combining other write barrier functionality suchas intergenerational pointer store trapping, as described above. Becauseto field 412 is available to hardware write barrier 840, the broadcastcan be performed in hardware and software trap overhead is eliminated.

FIG. 9 depicts an embodiment including Copy-To and How-Far registerfields (e.g., to field 412 and howfar field 413) in addition to aCopy-From register field (e.g., from field 411) with associated hardwarewrite barrier 940. The embodiment of FIG. 9 provides a write barrier tostores to fields of an object identified by the contents of from field411 and advantageously allows hardware write barrier 940 to forgobroadcasting of stores to a not yet copied portion of the large object,while eliminating partially relocated object trap handler 650 and itsassociated overheads. Like the above embodiments, this embodimentfacilitates incremental copying of large objects, but is not well suitedto bounded pause time update of large numbers of pointers to the ToSpace430 instance of a copied object. As before, handled object referencescan mitigate this limitation, allowing overall bounded pause timerelocation of even popular large objects, albeit at the expense of anadditional level of indirection.

By maintaining a Copy-To register field in hardware, e.g., as to field412 in registers 144, write accesses to the Copy-From instance can bebroadcast to both the Copy-From and Copy-To instances by hardware writebarrier 940. By further maintaining a How-Far register field inhardware, e.g., as howfar field 413 in registers 144, broadcasting canbe limited to those write accesses for which the particular target fieldof the write access has already been copied to ToSpace 430. In eithercase, handling of the write access to the partially relocated object iswithout software trap handler intervention. In one embodiment, hardwarewrite barrier 940 is provided by integer unit 142 (FIG. 1) logicresponsible for evaluating a store-oriented bytecode. In such anembodiment, logic implementing hardware write barrier 940 broadcastsstore₋₋ data to both the Copy-From and the Copy-To instances if thetarget object field is in an already copied portion of the large object,and directs store₋₋ data to the Copy-From instance if the target objectfield is in a not yet copied portion of the large object. An exemplaryhardware write barrier 940 is described by the following logicequations.

    ______________________________________    if (objectref == FROM)  {           if offset > HOWFAR then             store.sub.-- data => *(TO + offset)           store.sub.-- data => *(objectref + offset)    ______________________________________

where offset is the offset into the large object of the target fieldassociated with the store-oriented bytecode. In some embodiments, thedirecting of store₋₋ data to the Copy-From instance may be provided bysimply allowing the write access to complete normally without hardwarewrite barrier 940 intervention. Those of skill in the art willappreciate a variety of suitable logic implementations, including logicimplementations combining other write barrier functionality such asintergenerational pointer store trapping, as described above. Becausehowfar field 413 is available to hardware write barrier 940, hardwarewrite barrier 940 can selectively forgo writing store₋₋ data to theCopy-To instance. This slight optimization may improve performance byperforming only a single write rather than broadcasting two writes.

Write Barrier Associated with both Copy-From and Copy-To InstanceIdentifier Stores

Additional embodiments are now described with reference to FIGS. 10 and11. Like some of the previously described embodiments, these additionalembodiments exploit hardware support (e.g., a hardware write barrier andpartially relocated object identifier store 410) to appropriately handlewrites to the FromSpace 420 instance of a partially relocated largeobject without software trap handler intervention. However, in addition,these additional embodiments provide a barrier to writes to the ToSpace430 instance of a partially relocated large object. In this way, theseadditional embodiments, support both incremental copying of a largeobject and incremental update of pointers to a popular object foroverall bounded pause time relocation of large and/or popular objectswithout handled object references.

In the embodiments of FIGS. 10 and 11, garbage collector process 620incrementally updates pointers (i.e., objectrefs) to the large object.Mutator process 610 write accesses to either the FromSpace 420 instanceor the ToSpace 430 instance are broadcast (or appropriately directed) bya hardware write barrier, e.g., hardware write barrier 1040 or hardwarewrite barrier 1140, so that the two instances are kept "in sync" whilethe objectrefs are updated. Because the two instances are kept in sync,the memory referencing structure is robust to referencing states inwhich some objectrefs refer to a FromSpace 420 instance and others referto the corresponding ToSpace 430 instance. Bounded pause time update ofobjectrefs referring to the large object is accomplished byincrementally updating such objectrefs to refer to the ToSpace 430instance (rather than the FromSpace 420 instance). Note that in theembodiments of FIGS. 10 and 11, the FromSpace 420 instance and theToSpace 430 instance may not overlap.

Referring to FIG. 10, hardware write barrier 1040 provides a barrier towrite accesses to either copy-from instance 450 or copy-to instance450A. Hardware write barrier 1040 supports incremental, bounded-pausetime copying as described above with reference to hardware write barrier840. However, hardware write barrier 1040 is also responsive to Copy-Toregister field (e.g., to field 412). Write accesses to either copy-frominstance 450 or copy-to instance 450A are broadcast to both copy-frominstance 450 and copy-to instance 450A so that the data states of thetwo instances are synchronized. In this way, objectrefs to the partiallyrelocated large object may be updated incrementally, since a read accessto either instance will resolve to the same field state.

In one embodiment, hardware write barrier 1040 is provided by integerunit 142 (FIG. 1) logic responsible for evaluating a store-orientedbytecode. In such an embodiment, logic implementing hardware writebarrier 1040 broadcasts store₋₋ data to both Copy-From and Copy-Toinstances respectively identified by the contents of from field 411 andto field 412. An exemplary hardware write barrier 1040 is described bythe following logic equations.

    ______________________________________    if ((objectref == FROM) | | (objectref == TO)) {           store.sub.-- data => (FROM + offset)           store.sub.-- data => *(TO + offset)    ______________________________________

where offset is the offset into the large object of the target fieldassociated with the store-oriented bytecode. Those of skill in the artwill appreciate a variety of suitable logic implementations, includinglogic implementations combining other write barrier functionality suchas intergenerational pointer store trapping, as described above. Becausefrom field 411 and to field 412 are available to hardware write barrier1040, stores to the copy-from instance 450 or copy-to instance 450Arespectively identified thereby can be recognized and the broadcast toboth instances can be performed in hardware without software trapoverhead.

FIG. 11 depicts an embodiment that adds a How-Far register field (e.g.,howfar field 413) and a Mode indication (e.g., mode field 1114 ofregisters 144). As in the embodiment of FIG. 10, hardware write barrier1140 provides a barrier to write accesses to either copy-from instance450 or copy-to instance 450A. Hardware write barrier 1140 supportsincremental, bounded-pause time copying by ensuring that copied portionsof FromSpace 420 and ToSpace 430 instances are kept in sync. Hardwarewrite barrier 1140 advantageously allows hardware processor 100 to forgobroadcasting of stores to a not yet copied portion of the large objectduring a copying phase, which in the embodiment of FIG. 11, is indicatedby a COPY state of mode field 1114. However, during a pointer updatephase, indicated by a PTR₋₋ UPDATE state of mode field 1114, writesaccesses to either copy-from instance 450 or copy-to instance 450A arebroadcast to both copy-from instance 450 and copy-to instance 450A.Garbage collector process 620 updates mode field 1114 to correspond to acurrent phase of a large object relocation.

In one embodiment, hardware write barrier 1140 is provided by integerunit 142 (FIG. 1) logic responsible for evaluating a store-orientedbytecode. In such an embodiment, logic implementing hardware writebarrier 1140 broadcasts store₋₋ data to both the Copy-From and theCopy-To instances if the target object field is in an already copiedportion of the large object or if the large object has been completelycopied and relocation has entered a pointer update phase. During thecopying phase, logic implementing hardware write barrier 1140 directsstore₋₋ data to the Copy-From instance if the target object field is ina not yet copied portion of the large object. An exemplary hardwarewrite barrier 1140 is described by the following logic equations.

    ______________________________________    if ((objectref == FROM) | | (objectref == TO)) {    if ((offset ≧ HOWFAR) | | MODE == PTR.sub.--    UPDATE)) then    store.sub.-- data => *(TO + offset)    store.sub.-- data => *(FROM + offset)    ______________________________________

where the state of mode field 1114, MODE indicates a relocation phase(e.g., COPY or PTR₋₋ UPDATE) and offset is the offset into the largeobject of the target field associated with the store-oriented bytecode.Those of skill in the art will appreciate a variety of suitable logicimplementations, including logic implementations combining other writebarrier functionality such as intergenerational pointer store trapping,as described above. Because howfar field 413 and mode field 1114 areavailable to hardware write barrier 1140, hardware write barrier 1140can selectively forgo writing store₋₋ data to the Copy-To instanceduring the copying phase of a large object relocation, whilebroadcasting writes during the pointer update phase. This slightoptimization may improve performance by performing only a single write,rather than broadcasting two writes, during the copying phase.Additionally, relocation mode may be indicated by allowing garbagecollector process 620 to encode completion of the copying phase in astate of howfar field 413. Those of skill in the art will recognize thatin the above logic equations, a howfar field 413 value of less than orequal to zero (0) may be used to encode completion of the copy phasethereby obviating mode field 1114.

Read and Write Barriers Associated with Copy-From Instance IdentifierStore

Additional embodiments are now described with reference to FIGS. 12-14.Like some of the previously described embodiments, these additionalembodiments exploit hardware support (e.g., a hardware write barrier andpartially relocated object identifier store 410) to appropriately handlewrites to the FromSpace 420 instance of a partially relocated largeobject. However, these additional embodiments also provide a barrier toreads from a FromSpace 420 instance of a partially relocated largeobject. In this way, these additional embodiments support bounded-pausetime copying as well as bounded pause time update of pointers to thelarge object without handled object references.

In the embodiments of FIGS. 12-14, garbage collector process 620incrementally copies the large object from a FromSpace 420 instance to aToSpace 430 instance during a copy phase (MODE=COPY) and incrementallyupdates pointers (i.e., objectrefs) to the large object during a pointerupdate phase (MODE=PTR₋₋ UPDATE). During the copy phase of large objectrelocation, mutator process 610 write accesses to the FromSpace 420instance are broadcast or appropriately directed by a partiallyrelocated object trap handler, e.g., partially relocated object traphandler 1250 (FIG. 12), or by a hardware write barrier, e.g., hardwarewrite barrier 1340 (FIG. 13) or hardware write barrier 1440 (FIG. 14).During the pointer update phase of large object relocation, mutatorprocess 610 write and read accesses to the FromSpace 420 instance areredirected to the ToSpace 430 instance.

FIG. 12 depicts an embodiment including a Copy-From register field withassociated read and write barriers. In particular, the embodiment ofFIG. 12 includes from field 411, hardware read barrier 1242, hardwarewrite barrier 1241, and partially relocated object trap handler 1250.Hardware read barrier 1242 and hardware write barrier 1241 are shownillustratively as read and write barrier hardware 1240. However,depending on the implementation, hardware write barrier 1241 andhardware read barrier 1242 may share hardware or be based on separatehardware. In one embodiment, integer unit 142 (FIG. 1) logic responsiblefor evaluating store-oriented bytecodes provides hardware write barrier1241 and integer unit 142 logic responsible for evaluating load-orientedbytecodes (e.g., getfield₋₋ quick, getfield, aaload, etc.) provideshardware read barrier 1242.

Mutator process 610 makes read and write accesses from and to collectedspace 630. A given read or write access is selectively trapped by readand write barrier hardware 1240 if the read or write access targets theFromSpace 420 instance of a partially relocated object. Read and writebarrier hardware 1240 triggers partially relocated object trap handler1250 in response to a correspondence between the contents of from field411 and the target objectref associated with write access 701 or readaccess 1202. In one embodiment, read and write barrier hardware 1240 isresponsive to a mode field 1114 of registers 144 which alters thebehavior of hardware read barrier 1242 based on mode field 1114 state.In such an embodiment, hardware read barrier 1242 selectively traps onlyduring the pointer update phase of large object relocation.

An exemplary hardware write barrier 1241 is described by the followinglogic equations.

    ______________________________________             if (objectref == FROM) then               generate gc.sub.-- notify    ______________________________________

where gc₋₋ notify is a trap handler such as partially relocated objecttrap handler 1250. Those of skill in the art will appreciate a varietyof suitable logic implementations, including logic implementationscombining other write barrier functionality such as intergenerationalpointer store trapping, as described above. An exemplary hardware readbarrier 1242 is described by the following logic equations.

    ______________________________________    if ((MODE == PTR.sub.-- UPDATE) && (objectref == FROM)) then    generate gc.sub.-- notify    ______________________________________

Alternative embodiments may selectively trap during both copying andpointer update phases of large object relocation with appropriatehandling by partially relocated object trap handler 1250, though at theexpense of greater trap handler overhead.

During the copying phase, partially relocated object trap handler 1250,determines, or optionally maintains memory storage for, the Copy-Todestination information such as that otherwise stored in to field 412.In addition, partially relocated object trap handler 1250 may optionallymaintain storage for HowFar information such as that otherwise stored inhowfar field 413. When mutator process 610 stores to the FromSpace 420instance of the large object, store data is either broadcast to both thecopy-from instance 450 and copy-to instance 450A or, in embodimentswhich provide storage for howfar information, the howfar storage isinspected and the store is broadcast to both instances if the stored-tofield of the large object has already been copied, and otherwisedirected to copy-from instance 450.

During the pointer update phase, partially relocated object trap handler1250 directs read and write accesses targeting a FromSpace 420 instanceof a partially relocated large object to the ToSpace 430 instancethereof. As before, partially relocated object trap handler 1250,determines, or optionally maintains memory storage for, the Copy-Todestination information such as that otherwise stored in to field 412.In either case, partially relocated object trap handler 1250 redirectsboth read and write accesses to the ToSpace 430 instance. In this way, aread access to the partially relocated object resolves to the ToSpace430 instance which is guaranteed to be up to date.

Exemplary write trap and read trap functions for partially relocatedobject trap handler 1250 are as follows:

    ______________________________________    write.sub.-- trap ( ) {    if (objectref == FROM) {    store.sub.-- data => *(TO + offset)    if (MODE == COPY)            store.sub.-- data => *(objectref + offset)    }    read.sub.-- trap ( ) {    if (objectref == FROM) {    if (MODE == PTR.sub.-- UPDATE)            read.sub.-- destination <= *(TO + offset)    else read.sub.-- destination <= *(objectref + offset)    }    }    ______________________________________

where read₋₋ destination is the destination for a load-orientedbytecode.

In general, overhead imposed by trapping for the read-barrier case islikely to be greater than that in the case where only a write barrier isprovided, because read accesses are typically more common than writeaccesses in a given instruction stream, and in any case, are in additionto write accesses. In part for this reason, hardware read barrier 1242is selective for pointer update phase reads from FromSpace 420 instanceof the partially relocated large object. However, hardware read barrier1242 may optionally trap reads from the FromSpace 420 instance of thepartially relocated large object regardless of relocation phase. In suchan embodiment, partially relocated object trap handler 1250 may beconfigured to intelligently handle an overlapping copy-from instance 450and copy-to instance 450A. FIG. 15 illustrates an overlapping frominstance 1560 and to instance 1570 wherein a copied portion 1561 hasbeen copied to portion 1571 of to instance 1570. From field 411, tofield 412, and howfar field 413 encode the partially-relocated objectstate as described above. In the embodiment of FIG. 15, garbagecollector process 620 copies the large object from back to front (orfront to back) depending on the relative overlap of from instance 1560and to instance 1570. To facilitate overlapped from and to instances,partially relocated object trap handler 1550 does not broadcast writes,and instead directs a write targeting not copied portion 1562 to frominstance 1560 and directs a write targeting copied portion 1561 to toinstance 1570. A suitable modification to the write trap function ofpartially relocated object trap handler 1250 is as follows:

    ______________________________________    write.sub.-- trap ( ) {    if (objectref == FROM ) {    if (COPY.sub.-- DIRECTION == BACK.sub.-- TO.sub.-- FRONT) {    if ((offset ≧ HOW.sub.-- FAR) | |            (MODE == PTR.sub.-- UPDATE))            store.sub.-- data => *(TO + offset)    else store.sub.-- data => *(objectref + offset)    else {  /* COPY.sub.-- DIRECTION == FRONT.sub.-- TO.sub.-- BACK */    if ((offset ≦ HOW.sub.-- FAR) | |            (MODE == PTR.sub.-- UPDATE))            store.sub.-- data => *(TO + offset)    else store.sub.-- data => *(objectref + offset)    }    }    }    ______________________________________

where COPY₋₋ DIRECTION is ascertainable from the relative positions ofthe from instance 1560 and to instance 1570 as respectively encoded byfrom field 411 and to field 412. Modifications to the read trap functionof partially relocated object trap handler 1250 to appropriatelyredirect load-oriented accesses are analogous.

FIG. 13 depicts an embodiment including a Copy-To register field (e.g.,to field 412) in addition to a Copy-From register field (e.g., fromfield 411) with associated read and write barrier hardware 1340. Asbefore, this embodiment includes a mode indication (e.g., mode field1114 of registers 144) maintained by garbage collector process 620 toallow read and write barrier hardware 1340 to distinguish between a copyphase and a pointer update phase of large object relocation. Comparedwith the embodiment of FIG. 12, that of FIG. 13 provides both a readbarrier and write barrier support in hardware (e.g., as hardware readbarrier 1342 to stores to fields of an object identified by the contentsof from field 411 and a hardware write barrier 1341 to stores to fieldsof an object identified by the contents of from field 411), therebyadvantageously eliminating partially relocated object trap handler 1250and its associated overheads.

By maintaining a Copy-To register field in hardware, e.g., as to field412 in registers 144, write accesses to the Copy-From instance can bebroadcast during a copy phase (MODE=COPY) to both the Copy-From andCopy-To instances by hardware write barrier 1341 without software traphandler intervention. During a pointer update phase (MODE=PTR₋₋ UPDATE),write accesses to the Copy-From instance are redirected to the Copy-Toinstance by hardware write barrier 1341, again without software traphandler intervention. Read accesses from the Copy-From instance are alsoredirected during the pointer update phase, to the Copy-To instance byhardware read barrier 1342 without software trap handler intervention.Copy phase read accesses to the Copy-From instance complete normally.

In one embodiment, read and write barrier hardware 1340 is provided byinteger unit 142 (FIG. 1) logic responsible for evaluating bytecodes.Hardware write barrier 1341 is provided by integer unit 142 logicresponsible for evaluating store-oriented bytecodes and hardware readbarrier 1342 is provided by integer unit 142 logic responsible forevaluating load-oriented bytecodes.

During the copy phase, logic implementing hardware write barrier 1342broadcasts store₋₋ data to both Copy-From and Copy-To instancesrespectively identified by objectref and contents of to field 412,while, during the pointer update phase logic implementing hardware writebarrier 1342 redirects store₋₋ data to only the Copy-To instance. Anexemplary hardware write barrier 1342 is described by the followinglogic equations.

    ______________________________________    if (objectref == FROM) {           store.sub.-- data => *(TO + offset)           if (MODE == COPY)             store.sub.-- data => *(objectref + offset)    ______________________________________

Similarly, an exemplary hardware read barrier 1341 is described by thefollowing logic equations.

    ______________________________________    if (objectref == FROM) {    if (MODE == PTR.sub.-- UPDATE)           read.sub.-- destination <= *(TO + offset)    else read.sub.-- destination <= *(objectref + offset)    ______________________________________

where, in each case, offset is the offset into the large object of thetarget field associated with the store-, or load-oriented bytecode.Those of skill in the art will appreciate a variety of suitable logicimplementations, including logic implementations combining hardware readbarrier 1341 and hardware write barrier 1342, as well as implementationscombining hardware write barrier 1342 with other write barrierfunctionality such as intergenerational pointer store trapping, asdescribed above. Because to field 412 is available to hardware writebarrier 1342 and to hardware read barrier 1341, broadcast andredirection can be performed in hardware and software trap overhead iseliminated.

FIG. 14 depicts an embodiment that adds a How-Far register field (e.g.,howfar field 413). As in the embodiment of FIG. 13, read and writebarrier hardware 1440 provides barriers to read and write accesses fromand to copy-from instance 450. In addition, read and write barrierhardware 1440 steers read and write accesses to an appropriate FromSpace420 or ToSpace 430 instance depending on whether the field referenced bya store- or load-oriented bytecode has already been copied to theToSpace 430 instance. Operating in conjunction with howfar field 413,hardware write barrier 1441 advantageously allows hardware processor 100to forgo broadcasting of stores to a not yet copied portion of the largeobject during a copying phase indicated by a COPY state of mode field1114. During the pointer update phase, ToSpace 430 instance isguaranteed to be up to date; therefore, by redirecting readadvantageously forgo broadcasting of stores during the pointer updatephase. Because broadcast stores are eliminated, the embodiment of FIG.14 is particularly suited to support of overlapping FromSpace 420 andToSpace 430 instances.

In one embodiment, read and write barrier hardware 1440 is provided byinteger unit 142 (FIG. 1) logic responsible for evaluating bytecodes.Hardware write barrier 1441 is provided by integer unit 142 logicresponsible for evaluating store-oriented bytecodes and hardware readbarrier 1442 is provided by integer unit 142 logic responsible forevaluating load-oriented bytecodes. An exemplary hardware write barrier1442 is described by the following logic equations.

    ______________________________________    if (objectref == FROM) {    if (COPY.sub.-- DIRECTION == BACK.sub.-- TO.sub.-- FRONT) {    if ((offset ≧ HOW.sub.-- FAR) | |    (MODE == PTR.sub.-- UPDATE))     store.sub.-- data => *(TO + offset)    else store.sub.-- data => *(objectref + offset)    else {  /* COPY.sub.-- DIRECTION == FRONT.sub.-- TO.sub.-- BACK */    if ((offset ≦ HOW.sub.-- FAR) | |    (MODE == PTR.sub.-- UPDATE))     store.sub.-- data => *(TO + offset)    else store.sub.-- data => *(objectref + offset)    }    }    ______________________________________

Similarly, an exemplary hardware read barrier 1341 is described by thefollowing logic equations.

    ______________________________________    if (objectref == FROM) {    if (COPY.sub.-- DIRECTION == BACK.sub.-- TO.sub.-- FRONT) {    if ((offset ≧ HOW.sub.-- FAR) | |    (MODE == PTR.sub.-- UPDATE))     read.sub.-- destination <= *(TO + offset)    else read.sub.-- destination <= *(objectref + offset)    else {  /* COPY.sub.-- DIRECTION == FRONT.sub.-- TO.sub.-- BACK */    if ((offset ≦ HOW.sub.-- FAR) | |    (MODE == PTR.sub.-- UPDATE))     read.sub.-- destination <= *(TO + offset)    else read.sub.-- destination <= *(objectref + offset)    }    }    ______________________________________

where read₋₋ destination is the destination for a load-oriented bytecodeand where, in each case, offset is the offset into the large object ofthe target field associated with the store-, or load-oriented bytecode.Those of skill in the art will appreciate a variety of suitable logicimplementations, including logic implementations combining hardware readbarrier 1441 and hardware write barrier 1442, as well as implementationscombining hardware write barrier 1442 with other write barrierfunctionality such as intergenerational pointer store trapping, asdescribed above.

Read and Write Barriers Associated with Copy-To Instance IdentifierStore

A series of variations on the embodiments of FIGS. 12-14, include readand write barriers associated with a Copy-To instance identifier store,rather than with a Copy-From instance identifier store. As before, thesevariations add successive levels of additional hardware support, e.g.,from field 411 and howfar field 413 support, to eliminate software traphandler overhead and allow for overlapping copy-from and copy-toinstances 450 and 450A. The variations support both bounded-pause timecopying and bounded pause time update of pointers to a partiallyrelocated large object. These variations are now described by analogy tothe embodiments of FIGS. 12-14 and those of skill in the art willappreciate suitable modifications based on this description.

Garbage collector process 620 updates pointers to the large object,i.e., from the FromSpace 420 instance thereof to a ToSpace 430 instancethereof, before copying of the object data. In this way, the ordering ofpointer update and copying phases is reversed. Read and write barriersforward read and write accesses directed at copy-to instance 450Ainstead to copy-from instance 450. In one embodiment, hardware read andwrite barriers trap accesses to copy-to instance 450A, invoking asoftware partially relocated object trap handler that performs theactual forwarding to the Copy-From instance. The partially relocatedobject trap handler may optionally maintain storage for HowFarinformation such as that otherwise stored in howfar field 413. Whenmutator process 610 stores to the ToSpace 420 instance of the largeobject, store data is directed to the copy-to instance 450A if thestored-to field of the large object has already been copied, andotherwise directed to copy-from instance 450. Similarly, when mutatorprocess 610 loads from the ToSpace 420 instance of the large object, theload is performed from the copy-to instance 450A if the stored-to fieldof the large object has already been copied, and otherwise performedfrom copy-from instance 450. Support for overlapped FromSpace 430 andToSpace 430 instances is provided as described above with respect to theembodiments of FIGS. 12 and 14. Alternatively, if no support foroverlapping regions is needed, the read barrier can steer loads to theCopy-From instance, and the write barrier can broadcast stores to boththe Copy-From and Copy-To instances.

As above, software trap overhead can be eliminated by putting moreregisters and more complex behavior into the hardware. For example, oneembodiment includes to field 412 and from field 411. A hardware writebarrier responsive to correspondence between a store target and to field412 broadcasts stores to both copy-to instance 450A and copy-frominstance 450. A hardware read barrier responsive to correspondencebetween a load source and to field 412 redirects loads to copy-frominstance 450. Another embodiment, includes howfar field 413 in additionto from field 411 and to field 412. The hardware write barrier and thehardware read barrier direct stores and loads to copied portions ofcopy-to instance 450A and to uncopied portions of copy-from instance450. Those of skill in the art will appreciate suitable logic for eachof the embodiments based on the foregoing description.

Object Referencing Formats

FIG. 16 depicts one embodiment of an object reference (objectref) asrepresented in hardware processor 100. Three bits of the objectref canbe used for garbage collection hints as described in theabove-incorporated co-pending U.S. patent application Ser. No.08/841,543, entitled, "GENERATION ISOLATION SYSTEM AND METHOD FORGENERATION," naming James Michael O'Connor, Marc Tremblay, and SanjayVishin as inventors, and filed accesses thereto, hardware read barrier1442 allows hardware processor 100 to on Apr. 23, 1997. An additionalhandle bit H indicates whether the object is referenced by the objectrefdirectly or indirectly-through a handle. Handles provide a referencingmethod that facilitates, albeit at the cost of an additional level ofindirection, relocation of memory objects without large-scale updates ofpointers (or objectrefs) thereto. Both of these fields are masked outbefore being provided to integer unit 142 (FIG. 1) of hardware processor100.

In one embodiment of hardware processor 100 and collected space 630(FIGS. 6-14), an object 1700 is represented in memory including a headerportion 1710 and an instance variable storage portion 1720. FIG. 17Adepicts one such embodiment. Header portion 1710 includes a 32-bit wordthat itself includes a method vector table base portion 1712 forrepresenting object's class and five bits of additional storage 1714reserved for synchronization status of the object and information forthe garbage collector. Optionally, a second header-word, e.g., monitorpointer 1716, can contain the address of a monitor allocated for theobject, thereby making all five bits of additional storage 1714 in thefirst header word available for garbage collection information. In theembodiment of FIG. 17A, an object reference (objectref) points to thelocation of method vector table base portion 1712 to minimize theoverhead of method invocation.

Three bits of header portion 1710 are available to a garbage collectorsuch as collector process 620. In header portion 1710, threelower-order-bits (header 2:0!), and two high-order-bits (header 31:30!)are masked off when the header is treated as a pointer. Three of thesebits (header 31:30, 2!) are available to the garbage collector to storeinformation about object 1700. Bits 1 and 0 may used to hold LOCK andWANT bits for object synchronization. Alternatively, a second headerword, e.g., monitor pointer 1716, can be provided for maintaining thesynchronization status of object 1700, leaving all five bits for garbagecollection support. How the bits for garbage collection support are useddepends on the particular type(s) of garbage collection methodsimplemented collector process 620 and garbage collection trap handler,if any. Possible uses include mark bits, counter bits to age objectswithin a generation, etc. As described above, in an optional secondheader-word embodiment of header portion 1710, five bits are availableto a garbage collector such as collector process 620.

In the embodiment of FIG. 17A, instance variable storage portion 1720begins one word after the method vector table base portion 1712 andcontains instance variables of object 1700. The least significant bit ofan objectref specifies whether the reference is a handled (==1) or not(==0). An alternative, "handled," object format is depicted in FIG. 17B.A handled reference is established when object 1700b is created and allsubsequent references go through the handle, i.e., storage pointer 1750bto access the object. This support is provided for some types of garbagecollectors which reduce costs of pointer updating during objectrelocation by copying handles rather than the underlying object storage,including that for instance variables.

Handled object references allow garbage collection systems, such asthose described above with reference to FIGS. 7-9, to exhibit boundedpause time performance for pointer updates to a copied object. In othergarbage collection systems for which bounded pause time pointer updateof large numbers of referencing pointers is supported by the barrierconfiguration provided thereby, for example, in the embodimentsdescribed above with reference to FIGS. 10-14, direct object referencesare preferrable.

While the invention has been described with reference to variousembodiments, it will be understood that these embodiments areillustrative and that the scope of the invention is not limited to them.Claim terms such as first instruction, second instruction, thirdinstruction, etc. are for identification only and should not beconstrued to require a particular ordering. Many variations,modifications, additions, and improvements of the embodiments describedare possible. For example, although the present invention has beenherein described with reference to exemplary embodiments relating to theJAVA programming language and JAVA virtual machine, it is not limited tothem and, instead, encompasses systems, articles, methods, and apparatifor a wide variety of processor environments (both virtual andphysical). In addition, although certain exemplary embodiments have beendescribed in terms of hardware, suitable virtual machine implementations(JAVA related or otherwise) incorporating a partially relocated objectidentifier store and barrier(s) responsive thereto in accordance withthe above description include software virtual machine instructionprocessor implementations such as a bytecode interpreter or ajust-in-time (JIT) compiler. These and other variations, modifications,additions, and improvements may fall within the scope of the inventionas defined by the claims which follow.

What is claimed is:
 1. An apparatus comprising:memory storage, whereinobjects formed therein are relocatable from respective FromSpaceinstances to respective ToSpace instances thereof; a partially relocatedobject identifier store updatable to identify a FromSpace instance and aToSpace instance of a particular one of said objects, if any, for whichrelocation is incomplete; and a write barrier to a store-oriented memoryaccess targeting either of said FromSpace and said ToSpace instances ofsaid particular object, wherein said write barrier maintains consistencybetween said ToSpace instance and at least a copied portion of saidFromSpace instance, and wherein said write barrier allows incrementalupdate of pointers to said particular object.
 2. An apparatus, asrecited in claim 1,wherein said write barrier is responsive to acorrespondence between an object identifier for said store-orientedmemory access and contents of said partially relocated object identifierstore.
 3. An apparatus, as recited in claim 1,wherein said write barrierbroadcasts store data for said store-oriented memory access to both saidFromSpace and said ToSpace instances in response to a correspondencebetween an object identifier for said store-oriented memory access andcontents of said partially relocated object identifier store.
 4. Anapparatus, as recited in claim 3,wherein said write barrier selectivelyforgoes broadcasting store data if said store-oriented memory accesstargets an uncopied portion of said FromSpace instance, and insteaddirects said store data to said FromSpace instance and not to saidToSpace instance.
 5. An apparatus, as recited in claim 1,wherein saidpartially relocated object identifier store comprises a FROM field toidentify said FromSpace instance and a TO field to identify said ToSpaceinstance; wherein said write barrier comprises write barrier logiccoupled into a store path of a hardware processor to said memorystorage, said write barrier logic being responsive to a correspondencebetween an object identifier for said store-oriented memory access andcontents of either of said FROM field and said TO field.
 6. Anapparatus, as recited in claim 5, wherein said write barrier logicsupplies store data for said store-oriented memory access to both saidFromSpace and said ToSpace instances of said particular object, therebymaintaining said consistency.
 7. An apparatus, as recited in claim 5,wherein said write barrier logic supplies store data for saidstore-oriented memory access to said FromSpace instance and, if aportion of said particular object targeted by said store-oriented memoryaccess has been copied to said ToSpace instance, also to said ToSpaceinstance, thereby maintaining said consistency.
 8. An apparatus, asrecited in claim 1,further comprising a partial copy position indicatorto discriminate between said copied portion and an uncopied portion ofsaid FromSpace instance; wherein said write barrier broadcasts a secondstore-oriented memory access targeting said copied portion to both ofsaid FromSpace and said ToSpace instances; and wherein said writebarrier directs a third store-oriented memory access targeting saiduncopied portion to said FromSpace instance and not to said ToSpaceinstance.
 9. An apparatus, as recited in claim 1,further comprising apartial copy position indicator to discriminate between said copiedportion and an uncopied portion of either of said FromSpace and saidToSpace instances; wherein said write barrier broadcasts a fourthstore-oriented memory access targeting said copied portion of either ofsaid FromSpace and said ToSpace instances to both of said FromSpace andsaid ToSpace instances; and wherein said write barrier directs a fifthstore-oriented memory access targeting said uncopied portion to saidFromSpace instance and not to said ToSpace instance.
 10. An apparatus,as recited in claim 1,wherein, during a copy phase of relocation of saidparticular object, said write barrier broadcasts a sixth store-orientedmemory access targeting said copied portion to both said FromSpace saidToSpace instances; wherein, during said copy phase, said write barrierdirects a seventh store-oriented memory access targeting an uncopiedportion of said FromSpace instance to said FromSpace instance and not tosaid ToSpace instance; and wherein, during a pointer update phase, saidwrite barrier broadcasts an eighth store-oriented memory accesstargeting either of said FromSpace and said ToSpace instances to both ofsaid FromSpace and said ToSpace instances.
 11. An apparatus, as recitedin claim 10, further comprising:a partial copy position indicator todiscriminate between said copied portion and said uncopied portion; anda relocation mode indicator to indicate a current relocation phase,including said copy phase and said pointer update phase, for saidparticular object, said write barrier responsive to said relocation modeindicator.
 12. An apparatus, as recited in claim 10, furthercomprising:a partial copy position indicator to discriminate betweensaid copied portion and said uncopied portion, wherein said pointerupdate phase corresponds to a partial copy position indicator stateindicative of a completely copied state for said particular object. 13.An apparatus, as recited in claim 1, further comprising:a processorembodying said partially relocated object identifier store and saidwrite barrier; and mutator process instructions encoded in mediareadable by said processor and executable thereby, said mutator processinstructions including an instruction corresponding to saidstore-oriented memory access, and garbage collector process instructionsencoded in media readable by said processor and executable thereby, saidgarbage collector process instructions including an instruction sequenceto incrementally copy said particular object from said FromSpaceinstance to said ToSpace instance, to incrementally update pointersreferencing said FromSpace instance to reference said ToSpace instance,and to maintain said partially relocated object identifier store incorrespondence therewith, said instruction sequence being interruptableby said mutator process instructions.
 14. An apparatus, as recited inclaim 1, further comprising:a processor embodying said partiallyrelocated object identifier store and said write barrier; and mutatorprocess instructions encoded in media readable by said processor andexecutable thereby, said mutator process instructions including aninstruction corresponding to said store-oriented memory access, andrelocator process instructions encoded in media readable by saidprocessor and executable thereby, said relocator process instructionsincluding an instruction sequence to incrementally copy said particularobject from said FromSpace instance to said ToSpace instance, toincrementally update pointers referencing said FromSpace instance toreference said ToSpace instance, and to maintain said partiallyrelocated object identifier store in correspondence therewith, saidinstruction sequence being interruptable by said mutator processinstructions.
 15. An apparatus, as recited in claim 14, wherein saidrelocator process instructions are selected to perform one ofgenerational garbage collection, mark-sweep-compact garbage collection,copying garbage collection, and heap compaction with bounded pause time.16. An apparatus, as recited in claim 14,wherein said pointersreferencing said particular object directly reference said particularobject; and wherein said relocator process instructions are selected toperform one of generational garbage collection, mark-sweep-compactgarbage collection, copying garbage collection, and heap compaction withbounded pause time.
 17. An apparatus, as recited in claim 14, whereinsaid processor comprises a virtual machine instruction processor.
 18. Anapparatus, as recited in claim 14, wherein said processor comprises ahardware processor including register storage and logic embodying saidpartially relocated object identifier store and said write barrier. 19.An apparatus, as recited in claim 1, wherein said particular objectcomprises a large object.
 20. An apparatus, as recited in claim 1,wherein said particular object comprises a popular object.
 21. Anapparatus, as recited in claim 1, wherein said particular objectcomprises a large and popular object.
 22. An apparatus, as recited inclaim 1, wherein said write barrier comprises a first write barrier tostore-oriented memory accesses targeting said FromSpace instance and asecond write barrier to store-oriented memory accesses targeting saidToSpace instance.
 23. An apparatus, as recited in claim 1,a hardwareprocessor embodying said partially relocated object identifier store andsaid write barrier; a communications device coupled to said hardwareprocessor for receiving mutator process instructions for execution onsaid hardware processor, said mutator process instructions including afirst instruction corresponding to said store-oriented memory access;and media readable by said hardware processor to encode garbagecollector process instructions executable and said hardware processorfor incrementally copying said particular object and incrementallyupdating pointers thereto.
 24. An apparatus, as recited in claim1,further comprising first and second processors coupled to saidpartially relocated object identifier store and to said memory storage,said first processor including said write barrier; wherein saidrelocation comprises incremental copying of said particular object by agarbage collector process executable on said second processor, andwherein said store-oriented and said load-oriented memory accessesrespectively comprise write and read accesses by a mutator processexecutable on said first processor; and wherein said partially relocatedobject identifier store is maintained by said garbage collector processin correspondence with said incremental copying of said particularobject.
 25. An apparatus, as recited in claim 24, wherein said secondprocessor comprises a special purpose garbage collection processor. 26.An apparatus, as recited in claim 24, wherein said second processor isintegral with said memory storage, said second processor and said memorystorage together comprising a garbage collected memory module.
 27. Anapparatus, as recited in claim 1,wherein said partially relocated objectidentifier store is further updatable to identify a second of saidobjects for which relocation is incomplete; and wherein said apparatusfurther comprises first and second garbage collection processors coupledto said partially relocated object identifier store and to said memorystorage, relocation of said particular and said second objectscomprising incremental copying thereof by said first and said secondgarbage collection processors, respectively.
 28. A garbage collectionsystem to manage memory object instance consistency during relocation ofa particular memory object in a computer system providing boundedpause-time relocation of said particular memory object using incrementalcopying of said particular object from a FromSpace instance to a ToSpaceinstance thereof and using incremental update of direct referencingpointers thereto, said garbage collection system comprising:a partiallyrelocated object identifier store including identifier fields for saidFromSpace and said ToSpace instances; write barrier logic responsive toa correspondence between a target object identifier for a store-orientedmutator process access to said particular object and contents of eitherof said FromSpace and said ToSpace instance identifier fields, whereinsaid write barrier maintains consistency between said FromSpace and saidToSpace instances during said incremental copying and during saidincremental update of pointers.
 29. A garbage collection system, asrecited in claim 27,wherein, during said incremental copying, saidconsistency maintenance includes broadcasting a first store-orientedmutator process access targeting said FromSpace instance of saidparticular object to both said FromSpace and said ToSpace instancesthereof; and wherein, during said update of pointers, said consistencymaintenance includes broadcasting a second store-oriented mutatorprocess access targeting either of said FromSpace and said ToSpaceinstances of said particular object to both said FromSpace and saidToSpace instances thereof.
 30. A garbage collection system, as recitedin claim 27,wherein said partially relocated object identifier storefurther includes a partial copy position indicator to identify anuncopied portion of said particular object; and wherein said writebarrier logic selectively forgoes broadcast for a third store-orientedmutator process access to said uncopied portion, and instead directssuch access to said FromSpace instance.
 31. A method for relocating amemory object with bounded pause time impact on a mutator process havingaccess thereto, said method comprising:configuring a write barrier torespond to store-oriented accesses of said mutator process targetingeither of a From instance and a To instance of said memory object;incrementally copying said memory object from said From instance to saidTo instance; during said incremental copying and in response to a firstof said store-oriented accesses, broadcasting said first store-orientedaccess to both said From and said To instances.
 32. A method, as recitedin claim 31,wherein said write barrier configuring comprises updating apartially relocated object identifier store to identify said Frominstance and said To instance; and wherein said broadcasting is inresponse to a correspondence between an object identifier for said firststore-oriented access and contents of said partially relocated objectidentifier store.
 33. A method, as recited in claim 31, furthercomprising:maintaining a partial copy position indicator to discriminatebetween a copied portion and an uncopied portion of said memory object;and during said incremental copying and in response to a second of saidstore-oriented accesses targeting said uncopied portion, directing saidsecond store-oriented access to said From instance and not to said Toinstance.
 34. A method, as recited in claim 31, wherein saidbroadcasting is performed by said write barrier.
 35. A method, asrecited in claim 31, wherein said broadcasting is performed by traphandler software in response to a trap by said write barrier.
 36. Amethod, as recited in claim 31, further comprising:incrementallyupdating pointers to said memory object to refer to said To instancerather than to said From instance; and during said incremental updatingof pointers and in response to a third of said store-oriented access,broadcasting said third store-oriented access to both of said Frominstance and said To instance.
 37. A method, as recited in claim 36,further comprising distinguishing between said incremental copying andsaid incremental updating using a relocation mode indicator maintainedby a garbage collection process performing said incremental copying andsaid incremental updating of pointers.
 38. A method, as recited in claim36, further comprising distinguishing between said incremental copyingand said incremental updating using a partial copy position indicatormaintained by a garbage collection process.